import Mock from "mockjs";

const AnnouncementManagementList = Mock.mock("/AnnouncementManagementList", "post", () => Mock.mock({
  success: true,
  code: 200,
  message: '@cparagraph',
  data: {
    'content|10': [
      {
        "id|+1": 1,
        "type|1-2": 1,
        "salesOrganizationCode": "d3a23c646067490bb0b597613ffd9eab",
        "salesOrganization": "MANPOWER",
        "executionCode": "FIX_LOCATION",
        "executionName": "NAME",
        "updateTime": '@datetime()',
        "status|1-2": 1,
        "date": '@datetime()',
        "browseRecord": { haveRead: 12, unRead: 23 },
      },
    ],
    number: 1,
    numberOfElements: 10,
    size: 10,
    totalElements: 1169,
    totalPages: 117,
  }
}))

//浏览记录详情
const AnnouncementManagementBrwoseRecord = Mock.mock("/AnnouncementManagementBrwoseRecord", "get", () => Mock.mock({
  success: true,
  code: 200,
  message: '@cparagraph',
  data: {
    haveRead: ["黄小胖", "黄二胖"],
    unRead: ["黄小胖", "黄二胖", "黄小胖", "黄二胖"]
  }
}))

//公告管理详情
const AnnouncementManagementDetails = Mock.mock("/AnnouncementManagementDetails", "get", () => Mock.mock({
  success: true,
  code: 200,
  message: '@cparagraph',
  data: {
    //标题
    title: "这是标题",
    //分类
    classification: "value1",
    //发送对象
    sendTo: ["0-0"],
    //正文
    content: "<p>fjskjfsfkljwlejf</p>",
    //附件
    download: "关于经销商新品激励支持的政策通知.pdf"
  }
}))

const AnnouncementManagementClassification = Mock.mock("/AnnouncementManagementClassification", "get", () => Mock.mock({
  success: true,
  code: 200,
  message: '@cparagraph',
  data: [{
    value: "value1",
    name: "name1"
  }, {
    value: "value2",
    name: "name2"
  }]
}))

//发送对象
const AnnouncementManagementSendTo = Mock.mock("/AnnouncementManagementSendTo", "get", () => Mock.mock({
  success: true,
  code: 200,
  message: '@cparagraph',
  data:
    [
      {
        title: 'Node1',
        value: '0-0',
        key: '0-0',
        children: [
          {
            title: 'Child Node1',
            value: '0-0-0',
            key: '0-0-0',
          },
        ],
      },
      {
        title: 'Node2',
        value: '0-1',
        key: '0-1',
        children: [
          {
            title: 'Child Node3',
            value: '0-1-0',
            key: '0-1-0',
          },
          {
            title: 'Child Node4',
            value: '0-1-1',
            key: '0-1-1',
          },
          {
            title: 'Child Node5',
            value: '0-1-2',
            key: '0-1-2',
          },
        ],
      },
    ]
}))

//公告分类管理
const AnnouncementClassification = Mock.mock("/AnnouncementClassification", "post", () => Mock.mock({
  success: true,
  code: 200,
  message: '@cparagraph',
  data:
    [
      {
        //分类名称
        name: "name",
        //排序
        sort: 1,
        //状态
        status: 1,
        //所属销售组织
        salesOrganization: "salesOrganization",
        //操作人
        operator: "operator",
        //更新时间
        updateTime: "updateTime",
      }, {
        //分类名称
        name: "name",
        //排序
        sort: 2,
        //状态
        status: 2,
        //所属销售组织
        salesOrganization: "salesOrganization",
        //操作人
        operator: "operator",
        //更新时间
        updateTime: "updateTime",
      }
    ]
}))



export const AnnouncementManagementMock = {
  AnnouncementManagementList,
  AnnouncementManagementBrwoseRecord,
  AnnouncementManagementDetails,
  AnnouncementManagementClassification,
  AnnouncementManagementSendTo,
  AnnouncementClassification
}